package cn.bluethink.eguan.core.entity;

import java.util.Date;

import javax.persistence.Id;
import javax.persistence.Table;

import cn.bluethink.eguan.model.core.EgCheck;


/**
 * 审核记录实体类
 * @title 苏州中科蓝迪公司所有(c)2016-2021
 * @version 0.1.0
 * @describe
 * @author fanbl
 * @date 2019年2月19日
 *
 */
@Table(name="eg_check")
public class EgCheckEntity {
	// 主键
	@Id
	private Long id;
	
	// 审核 通过/未通过 理由
	private String reason;
	
	// 被审核类型
	private Integer otype;
	
	// 被审核类型id
	private Long oid;
	
	// 审核状态
	private Integer status;
	
	// 审核人id
	private Long uid;
	
	// 审核时间
	private Date ctime;

	/**
	 * 模型转实体类
	 * 
	 * @param egCheck
	 * @param uid
	 * @return
	 * @throws Exception
	 */
	public EgCheckEntity(EgCheck check){
		this.id = check.getId();
		this.oid = check.getObject() == null ? 0 : check.getObject().getId();
		this.otype = check.getObject() == null ? 0 : check.getObject().getType().getOtid();
		this.reason = check.getReason();
		this.status = check.getStatus();
		this.uid = check.getChecker() == null ? 0 : check.getChecker().getId();
		this.ctime = check.getcTime();
	}
	
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getReason() {
		return reason;
	}

	public void setReason(String reason) {
		this.reason = reason;
	}

	public Integer getOtype() {
		return otype;
	}

	public void setOtype(Integer otype) {
		this.otype = otype;
	}

	public Long getOid() {
		return oid;
	}

	public void setOid(Long oid) {
		this.oid = oid;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public Long getUid() {
		return uid;
	}

	public void setUid(Long uid) {
		this.uid = uid;
	}

	public Date getCtime() {
		return ctime;
	}

	public void setCtime(Date ctime) {
		this.ctime = ctime;
	}

}
